﻿namespace ufida.u9.ait.openapi
{
	using System;
	using System.Collections.Generic;
	using System.Text;
    using ufida.u9.ait.openapi.utils;
    using UFSoft.UBF.AopFrame;	
	using UFSoft.UBF.Util.Context;

	/// <summary>
	/// FADisposalDocSaveSV partial 
	/// </summary>	
	public partial class FADisposalDocSaveSV 
	{	
		internal BaseStrategy Select()
		{
			return new FADisposalDocSaveSVImpementStrategy();	
		}		
	}
	
	#region  implement strategy	
	/// <summary>
	/// Impement Implement
	/// 
	/// </summary>	
	internal partial class FADisposalDocSaveSVImpementStrategy : BaseStrategy
	{
		public FADisposalDocSaveSVImpementStrategy() { }

		public override object Do(object obj)
		{						
			FADisposalDocSaveSV bpObj = (FADisposalDocSaveSV)obj;

            //带事务,在V6.0不能生成交易分录
            //这里改为不带事务,通过DeleteDoc回滚
            return CodeUtils.DocSaveNT(bpObj, bpObj.Data, FADisposalBase.CreateDoc,
				(doc) =>
				{
                    FADisposalBase.CommitDoc(doc);
                    FADisposalBase.ApproveDoc(doc);
                    return doc;
				},
				FADisposalBase.DeleteDoc);
		}		
	}

	#endregion
	
	
}